home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / dev / amos / AMOS1097.lzh / AMOSLIST / 000113_amos-request@svcs1.digex.net_Fri Oct 10 21:36:24 1997.msg < prev    next >
Internet Message Format  |  1997-11-02  |  4KB

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail4.access.digex.net (8.8.5/8.8.5) with ESMTP id VAA28375
  3.     for <mcox@access.digex.net>; Fri, 10 Oct 1997 21:36:23 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id TAA02066
  6.     for amos-out; Fri, 10 Oct 1997 19:37:04 -0400 (EDT)
  7. Received: from mail3.access.digex.net (mail3.access.digex.net [205.197.247.4])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id TAA02063
  9.     for <amos-list@svcs1.digex.net>; Fri, 10 Oct 1997 19:37:03 -0400 (EDT)
  10. Received: from m6.sprynet.com (m6.sprynet.com [165.121.1.89])
  11.     by mail3.access.digex.net (8.8.5/8.8.5) with SMTP id TAA17702
  12.     for <amos-list@access.digex.net>; Fri, 10 Oct 1997 19:37:02 -0400 (EDT)
  13. Received: from sprynet.com (ragriffi@ad43-217.compuserve.com [199.174.161.217]) by m6.sprynet.com (8.6.12/8.6.12) with SMTP id QAA23207 for <amos-list@access.digex.net>; Fri, 10 Oct 1997 16:36:58 -0700
  14. From: Richard Griffith <ragriffi@sprynet.com>
  15. Reply-To: Richard Griffith <ragriffi@sprynet.com>
  16. To: AMOS mailing list <amos-list@access.digex.net>
  17. Date: Fri, 10 Oct 1997 19:32:51 +0500
  18. Message-ID: <yam7222.2556.119389288@m6.sprynet.com>
  19. In-Reply-To: <19971007182959.634.qmail@hotmail.com>
  20. X-Mailer: YAM 1.3.4 [040] - Amiga Mailer by Marcel Beck
  21. Organization: Lacking; Does not play well with others.
  22. Subject: Re: hunt?!
  23. MIME-Version: 1.0
  24. Content-Type: text/plain
  25. Status: O
  26. X-Status: 
  27.  
  28. On 07-Oct-97, MtL ManUtd wrote:
  29. >can anybody show me a little example on how the hunt command works?
  30.  
  31. I've been a bit distracted lately, but I found a short example
  32. that might be useful as an example. I have not seen any other
  33. responses, but if you already have the hang of HUNTing, just
  34. smack the old delete button.
  35.  
  36. The following code strips out the less than usefull elements
  37. of an 8SVX file, correcting several common problems in the
  38. process, and rewrites it. The PSVX routine uses HUNT to locate
  39. the header and body chunks of the just processed file to play
  40. it. Note that the PSVX routine knows it has been passed a
  41. bank with a good iff 8svx form, so it doesn't error check.
  42.  
  43. Hope this helps, (or at least doesnt get in your way)
  44. -Richard
  45.  
  46. ' signatures for sample files
  47. Global SIGFORM,SIG8SVX,SIGVHDR,SIGBODY
  48. LCONST["FORM"] : SIGFORM=Param
  49. LCONST["8SVX"] : SIG8SVX=Param
  50. LCONST["VHDR"] : SIGVHDR=Param
  51. LCONST["BODY"] : SIGBODY=Param
  52. ' audio fade variables 
  53. B$=Fsel$("**")
  54. If B$="" Then Stop 
  55. Open In 1,B$
  56. X=Lof(1)+42
  57. Close 1
  58. Reserve As Work 10,X
  59. Reserve As Work 11,X
  60. '
  61. STRIPSVX[B$]
  62. '
  63. Procedure STRIPSVX[N$]
  64.    'Follow I,L,J,K
  65.    A$=" " : A$=A$+A$+A$+A$
  66.    I=Start(10)
  67.    NI=Start(11)
  68.    Bload N$,Start(10)
  69.    If Leek(I)=SIGFORM and Leek(I+8)=SIG8SVX
  70.       Print "FORM ";
  71.       Add I,4
  72.       L=Leek(I)
  73.       Print " Len ";L;" ";
  74.       Add I,4
  75.       Copy Start(10),Start(10)+12 To NI : Add NI,12
  76.       For J=1 To 4 : Print Chr$(Peek(I)); : Add I,1 : Next J : Print 
  77.       T=Start(10)+L
  78.       While I<T
  79.          If Leek(I)=SIGVHDR or Leek(I)=SIGBODY
  80.             Print "rewriting . . . ";
  81.             CL=Leek(I+4)+8
  82.             Copy I,I+CL To NI
  83.             If(CL mod 2)=1 : Inc CL : End If 
  84.             NI=NI+CL
  85.          Else 
  86.             Print "skipping . . .  ";
  87.          End If 
  88.          Print "Chunk ";
  89.          For J=1 To 4 : Print Chr$(Peek(I)); : Add I,1 : Next J
  90.          K=Leek(I)
  91.          Print " Len ";K
  92.          Add K,4
  93.          If(K mod 2)=1 : Inc K : End If 
  94.          Add I,K
  95.       Wend 
  96.       Loke Start(11)+4,NI-Start(11)-8
  97.       PSVX
  98.       Bsave N$,Start(11) To NI
  99.    Else 
  100.       Print "Not an IFF FORM"
  101.    End If 
  102. End Proc
  103. '
  104. Procedure LCONST[A$]
  105.    A=Leek(Varptr(A$))
  106. End Proc[A]
  107. '
  108. Procedure PSVX
  109.    Voice %111
  110.    Volume %1000,63
  111.    If Leek(Start(11))=SIGFORM and Leek(Start(11)+8)=SIG8SVX
  112.       SBEG=Hunt(Start(11) To Start(11)+64,"VHDR")
  113.       SLEN=Leek(SBEG+8)+Leek(SBEG+12)
  114.       SRATE=Deek(SBEG+20)
  115.       SBEG=Hunt(SBEG To SBEG+512,"BODY")
  116.       SBEG=SBEG+8
  117.       Sam Raw %1000,SBEG,SLEN,SRATE
  118.    End If 
  119. End Proc
  120. '
  121.  
  122.